package com.itbaizhan.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/c8")
public class MyController8 {
    @RequestMapping("/t1")
    public String t1(){
        String s = null;
        s.length();
        return "baizhan";
    }

    @RequestMapping("/t2")
    public String t2(){
        int i = 1/0;
        return "baizhan";
    }

//    @ExceptionHandler(NullPointerException.class)
//    public String handle(Exception ex, Model model){
//        model.addAttribute("msg",ex);
//        return "error";
//    }
//
//    @ExceptionHandler(Exception.class)
//    public String handle2(Exception ex, Model model){
//        model.addAttribute("msg",ex);
//        return "error2";
//    }
}
